-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Set default layout.axis.tickmode to 'sync' when axis is overlaying
#7684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e7ee5b3 to
2be45e2
Compare
cb1bf35 to
c4c70fd
Compare
7230cfb to
7d71516
Compare
camdecoster
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I left a few small syntax suggestions, but it's good to go as is.
| var axListIType = axListI[axisType]; | ||
| if(!axListI.fixedrange && axListIType.tickmode === 'sync') activeAxIds.push(axListIType._id); | ||
| var axId = axListIType._id; | ||
| if(!axListI.fixedrange && axListIType.tickmode === 'sync' && activeAxIds.indexOf(axId) === -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if(!axListI.fixedrange && axListIType.tickmode === 'sync' && activeAxIds.indexOf(axId) === -1) { | |
| if(!axListI.fixedrange && axListIType.tickmode === 'sync' && !activeAxIds.includes(axId)) { |
| 'If *sync*, the number of ticks will sync with the overlayed axis', | ||
| 'set by `overlaying` property.' | ||
| 'set by `overlaying` property. When no other tick info is provided,', | ||
| 'overlyaing (non-categorical) axes default to *sync*, while other axes default to *auto*.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 'overlyaing (non-categorical) axes default to *sync*, while other axes default to *auto*.', | |
| 'overlaying (non-categorical) axes default to *sync*, while other axes default to *auto*.', |
| var isTypedArraySpec = require('../../lib/array').isTypedArraySpec; | ||
| var decodeTypedArraySpec = require('../../lib/array').decodeTypedArraySpec; | ||
|
|
||
| module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) { | |
| module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts = {}) { |
|
|
||
| module.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType, opts) { | ||
| if(!opts) opts = {}; | ||
| if (!opts) opts = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (!opts) opts = {}; |
Closes #7683
This PR slightly modifies the default
tickmodelogic, such thattickmodedefaults to'sync'rather than'auto'for overlaying axes. Motivation is explained in the linked issue.Note: One case is excluded: When the overlaying axis is categorical (or multicategory), tickmode continues to default to
'auto'rather than'sync', as'sync'causes unexpected behavior with categorical axes and is probably never intended by the user.